-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a pure v3 client #298
Conversation
val privateKeyBundle: PrivateKeyBundle | ||
get() = PrivateKeyBundleBuilder.buildFromV1Key(privateKeyBundleV1) | ||
get() = PrivateKeyBundleBuilder.buildFromV1Key(v1keys) | ||
|
||
val v1keys: PrivateKeyBundleV1 | ||
get() = privateKeyBundleV1 | ||
get() = privateKeyBundleV1 ?: throw XMTPException("V2 only function") | ||
|
||
val keys: PrivateKeyBundleV2 | ||
get() = privateKeyBundleV1.toV2() | ||
get() = v1keys.toV2() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic all seems fine here, but these names seem very confusing for me personally. The names aren't new in this PR though, so no need to block the change.
an example improvement might be:
( we already have the nullable class field privateKeyBundleV1
)
v1keys
could instead be called something likenonNullPrivateKeyBundleV1
keys
could instead be calledprivateKeyBundleV2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya this one really thew me off as well something I will be happy to kill with V2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes all look good, just adding some ideas/nits related to code organization. I think the new client v3 constructor, and making privateKeyBundleV1
and apiClient
both nullable is the right idea 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice updates!
In order to properly test 1to1 it would be nice to be able to create a pure v3 client. This will be necessary once we support SCW as well.